package com.ruoyi.web.controller.monitor;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.framework.manager.factory.IMongoLogService;
import com.ruoyi.framework.manager.factory.MongoLogSearchVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.LinkedHashMap;
import java.util.List;

@RestController
@RequestMapping("/crm/trackLog")
public class MongoLoController extends BaseController {
    @Autowired
    private IMongoLogService mongoLogService;

    @PreAuthorize("@ss.hasAnyPermi('crm:track:list')")
    @GetMapping("/list")
    public TableDataInfo list(MongoLogSearchVo searchVo){
        startPage();
        List<LinkedHashMap> list=mongoLogService.list(searchVo);
        return getDataTable(list);
    }
}
